import request from '../flow-request'
import { ResponseData } from '@/types/api/public'
import { TableList,EditData } from '@/types/api/flowDeploy'
import { AxiosResponse } from 'axios'

type ConfigType<T=ResponseData> = Promise<AxiosResponse<T>>

export const getData =(params:any):ConfigType<TableList> =>{
    params.pageable={};
    params.pageable.PageNo=params.current;
    params.pageable.PageSize=params.pageSize;
    const data= JSON.stringify(params);
    return request({
        url:'Api/v1/workflow/process-definitions/latest',
        method:'post',
        data,
        headers: {
            'Content-Type': 'application/json-patch+json'
        }
    })
}

export const startWorkFlowInstance =(params:any):ConfigType =>{ 
    const data= JSON.stringify(params);
    return request({
        url:'/Api/v1/workflow/process-instances/start',
        method:'post',
        data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}


